<template>
  <div id="weather" class="weather">
    <span class="demonstration"><h3>天气状况</h3></span>
    <div id="weather-v2-plugin-standard"></div>
  </div>
</template>
<script>
  window.WIDGET = {
    CONFIG: {
      "layout": 1,
      "width": "600",
      "height": "200",
      "background": 1,
      "dataColor": "#FFFFFF",
      "language": "zh",
      "borderRadius": "15",
      "key": "K7XOtIVpf5"
    }
  }
 export default {
    name: 'Weather',
    mounted() {
     (function (d) {
       const c = d.createElement('link')
       c.rel = 'stylesheet'
       c.href = 'https://apip.weatherdt.com/standard/static/css/weather-standard.css?v=2.0'
       const s = d.createElement('script')
       s.src = 'https://apip.weatherdt.com/standard/static/js/weather-standard.js?v=2.0'
       const sn = d.getElementsByTagName('script')[0]
       sn.parentNode.insertBefore(c, sn)
       sn.parentNode.insertBefore(s, sn)
     })(document)
   }
 }
</script>
<style lang="less" scoped>
  .weather{
    padding: 20px;
  }
</style>
